package org.maxkey.portal.repository;

import org.maxkey.portal.core.cam.PageResultData;
import org.maxkey.portal.core.cam.ResultData;
import org.maxkey.portal.model.UserInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface  UserInfoRepository extends JpaRepository<UserInfo, Integer> {


    @Query("select u from UserInfo u where u.loginname=:Loginname")
    UserInfo findUserByLoginname(@Param("Loginname") String Loginname);

    Page<UserInfo> findAll(Specification<UserInfo> spec, Pageable pageable);

}
